home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13764 < prev    next >
Encoding:
Text File  |  1996-08-05  |  816 b   |  34 lines

  1. Path: csun.edu!kc44097
  2. From: kc44097@csun.edu (chen)
  3. Newsgroups: comp.lang.c
  4. Subject: A weird thing about printf()
  5. Date: 10 Apr 1996 06:52:18 GMT
  6. Organization: California State University, Northridge
  7. Message-ID: <4kflr2$5if@dewey.csun.edu>
  8. NNTP-Posting-Host: louie.csun.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11.  
  12.   
  13.   The program :
  14.  
  15. #include <stdio.h>
  16.  
  17. int answer;
  18. main()
  19. {
  20.   answer=2+2;
  21.   printf("The answer is %d\n");
  22.   return 0;
  23. }
  24.  
  25.   In printf(),I lost "answer" in the end,but it works,and give me the
  26. result 0.I wonder how the compiler handle this condition.Also,is this
  27. allow by C?(by this, I mean is this a leagal usage in language itself,
  28. or just a mistake cause by the compiler?)
  29.  
  30.   Can someone give me some advice ? Please e-mail me :
  31.                    kc44097@huey.csun.edu
  32.  
  33.                  Thankx !!!!!!
  34.